const code = require('./code2')

var fs = require('fs')

let data = ''
for (let i = 0; i < 2000; i++) {
  const numCode = () => {
    const chars = '0123456789'
    const maxPos = chars.length
    let target = ''
    for (let i = 0; i < 6; i++) {
      target += chars.charAt(Math.floor(Math.random() * maxPos))
    }
    return target
  }
  for (let j = 0; j < 6; j++) {
    data += `${i + 1}-${j + 1}:06250018${numCode()}5348${code[i][j]} \n`
  }
}
fs.writeFile(
  '贵州习酒.御藏.txt',
  data,
  // 写入文件后调用的回调函数
  function (err) {
    if (err) throw err
    // 如果没有错误
    console.log('Data is written to file successfully.')
  }
)
